<?php
class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $this->_helper->layout->disableLayout();

        $user = Zend_Auth::getInstance()->getIdentity();

        if ($user)
        {
            $user->credential = NULL;
            $user->credential_expires = NULL;
            $user->save();
            Zend_Auth::getInstance()->clearIdentity();
        }

        setcookie('credential', '', time() - 60, '/', $_SERVER['HTTP_HOST']);

        if (Zend_Session::isDestroyed() == false)
            Zend_Session::destroy();

        
        //$this->_helper->layout->disableLayout();
    }
}